(function($f) {	$f.extend.feature("myFeature1", "myPlugin1, myPlugin2", "6276921d-bf9a-4fd7-a2e6-399fce447cba", function(self) {

	"use strict";
	
	// feature info
	this.featureInfo = {
		title: "My Feature 1",
		version: "0.0.1" // major.minor.build
	};

	// plugin events, subscriptions and handlers
	this.events = { 
		// event 2
		event2: "event2",
		
		// event subscriptions
		// define one item for each subscription - at runtime this will wire event subscriptions
		// and will be replaced by an event subscriptions object
		// each item here should be defined such:
		// <eventHandlerFunctionName>: ["FullyQualifiedEventNameToWhichToBindTo", "..."]
		// These eventHandlerFunctionName must exists under "eventHandlers" section
		subscriptions: { 
			onAppEvent1: ["com.myCompany.myApp.event1"]
		},
	
		// event handlers
		// each item define one event handler as:
		// <eventHandlerFunctionName>: function(e) { }
		// e is an object having following properties:
		//	name: fully qualified name of the event (incuding namespace)
		//	sender: sender object of the event
		//	args: what args were passed when event was raised
		//	cancel: a method to cancel further execution of the event propogation code
		handlers: { 
			onAppEvent1: function(e) {
				var element = $("#eventsLog");
				element.append("<p>" + self.info.title + " has handled '" + e.name + "' event of " + e.sender.info.title + ". Args: " + e.args[0].toString());
				
				if (self.handle.name === "myPlugin1") {
					if (confirm("You can cancel further handling of this event. Do you want to stop?")) {
						element.append("Further handling of this event is stopped.");
						
						// cancel further event propogation
						// event are handled by plugins - in order they subsribe to event - which in case
						// of plugins is order of their loading - which is controlled by z-index
						e.cancel();
					};
				};
			}
		}
	};	
}); }(fluid));
